<!--
 * @Description  : 
 * @Version      : 1.0
 * @Author       : Shiming
 * @Date         : 2022-01-12 10:52:50
 * @LastEditors  : Shiming
 * @LastEditTime : 2022-05-10 13:55:39
 * @FilePath     : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\receipts-audit\\receipts-audit.component.html
 * Copyright (C) 2022 huzhenhong. All rights reserved.
-->
<!-- 搜索表单 -->
<!-- <page-header-wrapper [title]="''"> </page-header-wrapper>
<nz-card>
  <div nz-row nzGutter="8">
    <div nz-col [nzSpan]="_$expand ? 24 : 18">
      <sf #sf [schema]="schema" [ui]="ui" [compact]="true" [button]="'none'"></sf>
    </div>
    <div nz-col [nzSpan]="_$expand ? 24 : 6" [class.text-right]="_$expand">
      <button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="search()" acl
        [acl-ability]="['ORDER-RECEIPTS-search']">查询</button>
      <button nz-button nzType="primary" [disabled]="false" (click)="exprot()">导出</button>
      <button nz-button [disabled]="false" (click)="resetSF()">重置</button>
      <button nz-button nzType="link" (click)="expandToggle()">
        {{ !_$expand ? '展开' : '收起' }}
        <i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
      </button>
    </div>
  </div>
</nz-card> -->

<nz-card class="table-box">
  <div class="tab_header">
    <label class="page_title"> <label class="driver">|</label> 资金报表</label>
    <nz-tabset (nzSelectedIndexChange)="selectChange($event)" [nzTabBarExtraContent]="extraTemplate">
      <nz-tab [nzTitle]="'无资金数据(' + tabs?.stayQuantity + ')'"></nz-tab>
      <nz-tab [nzTitle]="'有资金数据(' + tabs?.receivedQuantity + ')'"></nz-tab>
      <nz-tab [nzTitle]="'全部(' + tabs?.totalCount + ')'"></nz-tab>
    </nz-tabset>
  </div>

    <st
      #st
      [bordered]="true"
      [scroll]="{ x: '2000px', y: scrollY }"
      [data]="service.$api_queryZjDataList"
      [columns]="columns"
      [req]="{ process: beforeReq }"
      [res]="{ reName: { list: 'data.records', total: 'data.total' }, process: afterRes }"
      [page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
      [loading]="false"
    >
      <ng-template st-row="freightPrice" let-item let-index="index">
        {{ item.freightPrice | currency }}
      </ng-template>
      <ng-template st-row="billCode" let-item let-index="index">
        <div>{{ item.billCode }}</div>
        <!-- <a *ngIf="item.billType == '1'" [routerLink]="'/order-management/vehicle/vehicle-detail/' + item.id">{{ item.billCode }}</a>
        <a *ngIf="item.billType == '2'" [routerLink]="'/order-management/bulk/bulk-detail/' + item.id">{{ item.billCode }}</a>
        <a *ngIf="item.billType == '3'" [routerLink]="'/order-management/vehicle/vehicle-detail/' + item.id">{{ item.billCode }}</a>
        <div>
          <span>{{ item?.billTypeLabel }}{{ item?.serviceTypeLabel }}</span>
        </div> -->
      </ng-template>
  
      <ng-template st-row="createTime" let-item let-index="index">
        <div >
           {{ item.createTime.substring(0,10)  }}
        </div>
        <div >
           {{ item.createTime.slice(10)  }}
        </div>
      </ng-template>
  
      <ng-template st-row="wayAmount" let-item let-index="index">
        <div >
           {{ item.wayAmount | currency }}
        </div>
      </ng-template>
      <ng-template st-row="diffAmount" let-item let-index="index">
        <div >
           {{ item.diffAmount | currency }}
        </div>
      </ng-template>
      <ng-template st-row="payAmount" let-item let-index="index">
        <div >
           {{ item.payAmount | currency }}
        </div>
      </ng-template>
      <ng-template st-row="diffAmount" let-item let-index="index">
      
        <div *ngIf="item.diffAmount == 0">
          {{ item.diffAmount | currency }}
       </div>
       <div style="color: red;" *ngIf="item.diffAmount != 0">
          {{ item.diffAmount | currency }}
       </div>
      </ng-template>
    </st>
</nz-card>

<ng-template #extraTemplate>
  <div>
    <button nz-button nzDanger [nzLoading]="service.http.loading" (click)="openDrawer()" 
      >筛选</button>
    <!-- <button nz-button nzDanger [disabled]="false" (click)="exprot()" >导出</button> -->
    <button nz-button nzDanger [disabled]="false" acl [acl-ability]="['superviseOrderSucceed-batchSynchronization']" (click)="sign1()" >批量同步</button>
  </div>
</ng-template>
